//
//  HQQNetworkManager.h
//  HQQNetworkExemple
//
//  Created by 黄强强 on 16/7/7.
//  Copyright © 2016年 黄强强. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef void(^HQQNetworkSuccessBlock)(NSInteger status, NSString *message, id response);
typedef void(^HQQNetworkFailureBlock)(NSError *error);

@interface HQQNetworkManager : NSObject

+ (instancetype)sharedManager;


#pragma mark - GET

- (void)GET:(NSString *)urlString paramters:(NSDictionary *)paramters responseClass:(Class)responseClass success:(HQQNetworkSuccessBlock)success failure:(HQQNetworkFailureBlock)failure;

/**
 *  GET
 *
 *  @param urlString     url
 *  @param paramters     参数
 *  @param needCache     是否缓存response
 *  @param responseClass 返回对象的class
 *  @param success       请求成功的回调
 *  @param failure       请求失败的回调
 */
- (void)GET:(NSString *)urlString paramters:(NSDictionary *)paramters needCache:(BOOL)needCache responseClass:(Class)responseClass success:(HQQNetworkSuccessBlock)success failure:(HQQNetworkFailureBlock)failure;


#pragma mark - POST

- (void)POST:(NSString *)urlString paramters:(NSDictionary *)paramters responseClass:(Class)responseClass success:(HQQNetworkSuccessBlock)success failure:(HQQNetworkFailureBlock)failure;

/**
 *  POST
 *
 *  @param urlString     url
 *  @param paramters     参数
 *  @param needCache     是否缓存response
 *  @param responseClass 返回对象的class
 *  @param success       请求成功的回调
 *  @param failure       请求失败的回调
 */
- (void)POST:(NSString *)urlString paramters:(NSDictionary *)paramters needCache:(BOOL)needCache responseClass:(Class)responseClass success:(HQQNetworkSuccessBlock)success failure:(HQQNetworkFailureBlock)failure;

@end
